package com.example.jbmsuppliers.sinopec.activity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.TextView;

import com.example.jbmsuppliers.R;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Created by 家帮忙 on 2016/12/1.
 */

public class MyGunYuSM extends OvertActivity {


    String url = "http://web.jiabangmang.com/apphelp";
    @InjectView(R.id.goback_ps_set)
    Button gobackPsSet;
    @InjectView(R.id.titlelz)
    TextView titlelz;
    @InjectView(R.id.webview)
    WebView webview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_assets);
        ButterKnife.inject(this);

        titlelz.setText("帮助中心");
        WebSettings settings = webview.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setLoadWithOverviewMode(true);//和setUseWideViewPort(true)一起解决网页自适应问题
        settings.setAppCacheEnabled(true);//是否使用缓存
        settings.setLoadWithOverviewMode(true);
        settings.setUseWideViewPort(true);//
        settings.setAllowFileAccess(true);
        settings.setLoadsImagesAutomatically(true);
        settings.setAppCacheMaxSize(1024 * 1024 * 8);
        settings.setDomStorageEnabled(true);
        settings.setDatabaseEnabled(true);
        webview.loadUrl(url);
        webview.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView webview, String url) {
                webview.loadUrl(url);
                return true;
            }

        });


    }


    @OnClick(R.id.goback_ps_set)
    public void onClick() {
        finish();
    }
}
